<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>爱优商城-团购</title>
<link href="themes/default/css.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
body{
	background:url(images/background.jpg) no-repeat 0 0;
	margin:0px;
}
</style>
<body>
  <div id="contanier">
    <div id="top">
      <div class="topcenter"> <a href="http://www.2155.com/"><img src="images/th1440-4594_03.jpg" border="0" /></a>
      <img style="margin-left:135px" src="images/tg1440-4594-_05.jpg" border="0" />&nbsp;&nbsp;&nbsp;
      <a href="http://www.2155.com/user.php?act=register" class='border_a'>免费注册</a>
      <a href="http://www.2155.com/user.php" class='border_a'>登陆</a>
      <p class="huanyi" id='welcome' style='right:250px;'>您好，欢迎来到爱优商城！</p>
      
      </div>
    </div>
    <script>
    function welcome_left(){
    	var o = document.getElementById("welcome");
    	right = parseInt(o.style.right);
    	if(right < 350){
    		window.setTimeout(function(){welcome_left()},100);
    	} else {
    		return;
    	}
    	o.style.right = (right+2)+"px";
    }
    welcome_left();
    </script>
    <div id="main">
       <div class="maintop"> 
       <div style='float:left'>
		       <a href="http://www.2155.com/">
		       <img src="images/tg1440-4594-_14.jpg" border="0" />
		       </a>
		       <p class="aytg">爱优团购</p>
		</div>
	   <div style='float:right'>
	       <div style="position:relative;top:50px;left:-50px;position:relative">
			    	<a class="tab_border" href="#">玩转爱优团购</a>
			    	<a class="tab_border" href="{$feed_url}" target="_blank">团购信息订阅</a>
			    	<a class="tab_border" href="http://www.wishar.com:9222/user.php?act=group">我的爱优</a>
			    	<img src="images/group_flow.gif" style='position:absolute;z-index:1000;top:-14px' border=0 />
			    	<a class="tab_border" style='padding-left:40px' href="/flow.php">去购物车结算</a>
		   </div>
	   </div>
       </div>
       <div class="detail">
          <div class="detail_content">
               <h2 style='height:50px;overflow:hidden'>{$group_buy.act_desc|escape:html}</h2>
               <form action="group_buy.php?act=buy" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
            <div class="cont_left">
               <div class="sall">
                 <div class="jiantou">
                 <input name="number" type="hidden" class="inputBg" id="number" value="1" size="4" />
                 <input type="hidden" name="group_buy_id" value="{$group_buy.group_buy_id}" />
                   <a href="javascript:ECS_FORMBUY.submit()"><img  src="images/jiantou.png" border="0" /></a>
                 </div>
                 <div class="qg_jg">
                   ￥{$group_buy.price_ladder[0].price}
                 </div>
                 <div class="jgg">
                 <p>原价&nbsp;&nbsp; 折扣&nbsp;&nbsp; 节省</p>
                    <p><span style="text-decoration:line-through">{$gb_goods.shop_price}</span> &nbsp;&nbsp;<span style="color:#fd4685; font-weight:bold">{$gb_goods.discount}折</span>&nbsp;&nbsp;  {$gb_goods.save} </p>
                 </div>
               </div>
               <div class="pep">
                  <p style="text-align:center">
                    <span style="color:#fd4685; font-size:26px; font-weight:bold" >{$group_buy.total_order}</span>人已购买<br />
剩余{$gb_goods.time_remain}
                  </p>
               </div>
               <div class="num">
                  <p style="text-align:center; padding-top:15px; font-size:18px">
                    最低参团人数：{$group_buy.price_ladder[0].amount}
                  </p>
               </div>
            </div>
            </form>
            <div class="cont_middle">
               <div class="cp">
                 </a><div style='width:300px;height:300px;overflow:hidden'><a href="{$gb_goods.url}"><img src="{$gb_goods.goods_img}" border="0" /></a></div>
               </div>
              <div class="ck"> <a class="detail_a" href="{$gb_goods.url}">查看商品详情</a>
               </div>
             <div class="fx">
                 <span style="font-size:12px; float:left; margin-left:10px">分享</span>
                 <!-- JiaThis Button BEGIN -->
					<div id="ckepop">
					<a class="jiathis_button_tsina"></a>
					<a class="jiathis_button_tqq"></a>
					<a class="jiathis_button_renren"></a>
					<a class="jiathis_button_douban"></a>
					<a class="jiathis_button_qzone"></a>
					<a class="jiathis_button_kaixin001"></a>
					<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
					<!--  <a class="jiathis_counter_style"></a>-->
					</div>
					<script type="text/javascript" >
					var jiathis_config={
						summary:"",
						hideMore:false
					}
					</script>
					<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
				<!-- JiaThis Button END -->

                 
               </div>
            </div>
            <div class="cont_bottom">
              <div class="bottop">
                  <p style="text-align:center; font-size:14px">精彩的评论可能获得免单机会哦！</p>
              </div>
               <div class="pj">
               {insert_scripts files='transport.js,utils.js'}
				<div id="commentlist" style='height:200px;'>
					正在载入留言......
				</div>
				<div id='comments'>
					<textarea style='width:200px;height:40px;margin-left:10px' id='comment_content'></textarea>
				</div>
               </div>
              <div class="tj">
              <a href="javascript:add_comments()" class="tab_border" style='position:relative;top:3px;left:-3px;font-size:12px;padding:2px'>提交评论
              </a>
              </div>
            </div>
            
             
</div>
       </div>
       
       <div style='margin:0 auto;width:800px'>
       	{$gb_goods.goods_desc}
       </div>
       <div class="footer">
          <img style="display:block" src="images/detail1440-1267_03.jpg" border="0" />
          <img style="display:block" src="images/detail1440-1267-_05.jpg" border="0" />
          
      <div class="foot_content">
            
        <p style="font-size:14px; margin-top:30px">
              <img src="images/wx.gif" border="0" /> &nbsp;&nbsp;爱优团购是什么？<br />
<span style="margin-left:30px">爱优商城每周都会精心准备2~3款产品举办一次团购活动，为了确保让顾客享受到极高性价比的商品，爱优商城会联系相关供应商做好
品质量检测工作。只要在一定时间内凑够最低团购人数就能享受无敌折扣。</span></p><br />

<p style="font-size:14px; "> <img src="images/wx.gif" border="0" />&nbsp;&nbsp;团购可以货到付款吗？<br />
<span style="margin-left:30px">不可以，团购是需要预先支付货款的，您可以通过在线支付或者通过爱优小钱包预存款来支付。</span></p><br />
<p style="font-size:14px;">
 <img src="images/wx.gif" border="0" />&nbsp;&nbsp;如果没有凑够最低团购人数怎么办？<br />
<span style="margin-left:30px">如果没有凑够最低团购人数的话，那么本次团购就会取消，已经支付过款项会返回您的爱优小钱包。</span></p><br />
<p style="font-size:14px;">
 <img src="images/wx.gif" border="0" />&nbsp;&nbsp;爱优团购免单是怎么回事？<br />
<span style="margin-left:30px">每个团购项目我们都会设立团员互动区给对此款团购品感兴趣的团员们商讨评论，如果您对此款商品有独到见解，不妨写出来和大家分享
哦，我们爱优评论审核小组会给予优秀的评论者免费获得此款商品的机会，将您的货款退回您的爱优小钱包。</span></p><br /><br />

            </p>
          </div>
          
       </div>
       
       
    </div>
    
  </div>
              <script>
              $group_id = '{$group_buy.goods_id}';
              cpage     = 1;
              get_comments()
              function get_comments(){
            	  Ajax.call('comment.php', "action=get&act=group_comment&act_id="+$group_id+"&comment_type=88&cpage="+cpage, commentResponse, 'POST', 'JSON');
              }
              
              function add_comments(){
            	  var content    = document.getElementById("comment_content").value;
            	  var user_id  = '{$smarty.session.user_id}';
            	  if(!user_id){
            		  alert('请先登录');
            		  return;
            	  }
            	  if(!content){
            		  alert('请填写留言内容');
            		  return;
            	  }
            	  if(content.length > 200){
            		  alert('请不要填写太长的留言');
            		  return;
            	  }
            	  Ajax.call('comment.php', "action=add&act=group_comment&act_id="+$group_id+"&comment_type=0&content="+content, commentResponse2, 'POST', 'text');
              }
              
              function commentResponse2(r){
            	  alert(r);
            	  if(r == '留言成功，请等待审核！'){
            		  document.getElementById("comment_content").value = '';
            	  }
              }
              function gotopage(page){
            	  if(!isNaN(page)){
            		  cpage = page;
                	  get_comments();
            	  } else {
            		  if(page == 'add'){
            			  ++cpage;;
                    	  get_comments(); 
            		  } else if(page == 'desc') {
            				  --cpage;;
                        	  get_comments();
            		  }
            	  }
            	  
              }
              function commentResponse(r){
            	  var p = document.getElementById("commentlist");
            	  
            	  var count = r['count'];
            	  var totalpage = parseInt(count / 4) +1;
            	  r     = r['data'];
            	  if(!r){
            		  p.innerHTML = '还没有留言哦！';
            		  return;
            	  }
            	  var html = "<table class='comment_table' cellpadding=0 cellspacing=0 width='228'>";
            	  for(i=0;i<r.length;i++){
            		  html+= "<tr><td><div width=80 style='color:blue;font-weight:bolder;'>"+r[i].user_name+":</div></td><td width=148><div style='height:40px;width:148px;word-wrap:break-word;overflow:hidden'>"+r[i].content+"</div></td></tr>";
            	  }
            	  html+="</table>";
            	  html+="<div class='group_commen_page'>";
            	  if(cpage == 1 && totalpage>cpage){
            		  html+= "<span onclick=gotopage('add')>下一页</span><span onclick='gotopage("+totalpage+")'>末页</span>";
            	  } else if (cpage >1 && cpage <totalpage){
            		  html+= "<span onclick='gotopage(1)'>首页</span><span onclick=gotopage('desc')>上一页</span><span onclick='gotopage('add')'>下一页</span><span onclick='gotopage("+totalpage+")'>末页</span>";
            	  } else if (cpage == totalpage && cpage != 1){
            		  html+= "<span onclick='gotopage(1)'>首页</span><span onclick=gotopage('desc')>上一页</span>";
            	  }
            	  html+="共有"+count+"条记录</div>";
            	  p.innerHTML = html;
              }
              </script>  
</body>
</html>
